package com.five.controller.backstage;

import com.five.dao.backstage.TuiFangDao;
import com.five.entity.backstage.TuiFang;
import com.five.util.LayTable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.view.InternalResourceViewResolver;

import java.util.List;
import java.util.Map;

/**
 * @ClassName TuiFang
 * @Description TODO
 * @Author yuanshuaiqiang
 * @Date 2020/12/3 15:46
 */
@RestController
@RequestMapping("tuifang")
public class TuiFangController {

    @Autowired
    private TuiFangDao tuiFangDao;

    @RequestMapping("queryAll")
    public LayTable queryAll(Integer page, Integer limit, TuiFang tuiFang) {
        List<Map> maps = tuiFangDao.queryAll(page, limit,tuiFang);
        int i = tuiFangDao.getcount(tuiFang);
        LayTable layTable = new LayTable(i, maps);
        return layTable;
    }
}
